SetColor
Sets the text color to the current paragraph in the RGB format.
Syntax
expression.SetColor(r, g, b, isAuto);
expression
- A variable that represents a ApiParagraph class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
r | Required | byte | Red color component value. | |
g | Required | byte | Green color component value. | |
b | Required | byte | Blue color component value. | |
isAuto | Optional | boolean | false | If this parameter is set to "true", then r,g,b parameters will be ignored. |
Returns
Example
This example sets the text color to the current paragraph in the RGB format.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a paragraph with the font color set to orange.");
paragraph.SetColor(255, 111, 61);